if __name__ == '__main__':
    # 三维结构按照层存储
    # 二维结构按照行存储
    cubic = [
        # 底层
        [
            # 第一行
            [1, 2, ],
            # 第二行
            [3, 4]
        ],
        # 顶层
        [
            # 第一行
            [5, 6],
            # 第二行
            [7, 8]
        ]
    ]

    total = 0;
    # 按层分割
    i = 0
    while i < 2:
        j = 0
        # 按行分割
        while j < 2:
            k = 0
            # 按列分割
            while k < 2:
                total = total + cubic[i][j][k]
                k = k + 1
            j = j + 1
        i = i + 1

    print("total: " + str(total))
